/**
 * 项目示例-列表表头
 * Date 2023-11-02 14:27:20
 * 可选参数可参考：https://element-plus.org/zh-CN/component/table.html#table-column-属性
 */

export const exampleColumns = [
  { type: 'index', label: '序号', width: 60, align: 'center' },
  {
    prop: 'onDuty', label: '日期', minWidth: 200,sortable: true,align: 'center', ellipsis: true,
    formatter: function (row: any, column: any, cellValue: any) {
      if (row.schemeDate) {
        return row.schemeDate+'-'+row.scheduleDate
      } else {
        return '-'
      }
    }
  },
  {
    prop: 'name', label: '姓名', minWidth: 100, align: 'center', ellipsis: true,
    formatter: function (row: any, column: any, cellValue: any) {
      if (cellValue) {
        return cellValue
      } else {
        return '-'
      }
    }
  },
  {
    prop: 'staffNumber', label: '工号', minWidth: 100, sortable: true,  align: 'center', ellipsis: true,
    formatter: function (row: any, column: any, cellValue: any) {
      if (cellValue) {
        return cellValue
      } else {
        return '-'
      }
    }
  },
  {
    prop: 'organName', label: '组织', minWidth: 100,align: 'center', ellipsis: true,
    formatter: function (row: any, column: any, cellValue: any) {
      if (cellValue) {
        return cellValue
      } else {
        return '-'
      }
    }
  },
  {
    prop: 'positionName', label: '岗位', minWidth: 100, align: 'center', ellipsis: true,
    formatter: function (row: any, column: any, cellValue: any) {
      if (cellValue) {
        return cellValue
      } else {
        return '-'
      }
    }
  },
  {
    prop: 'officeHours', label: '考勤时段', minWidth: 200,align: 'center', ellipsis: true,
    formatter: function (row: any, column: any, cellValue: any) {
      if (cellValue) {
        return row.officeHours+"-"+row.closingTime
      } else {
        return '-'
      }
    }
  },
  {
    prop: 'onDuty', label: '上班打卡时间', minWidth: 200,align: 'center', ellipsis: true,
    formatter: function (row: any, column: any, cellValue: any) {
      if (cellValue) {
        return cellValue.substring(10,16)
      } else {
        return '-'
      }
    }
  },
  {
    prop: 'offDuty', label: '下班打卡时间', minWidth: 200,align: 'center', ellipsis: true,
    formatter: function (row: any, column: any, cellValue: any) {
      if (cellValue) {
        return cellValue.substring(10,16)
      } else {
        return '-'
      }
    }
  }]
